<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>{:$page_info['title']}</title>
<link rel="icon" href="favicon.ico" type="image/ico">

<meta name="author" content="yinqi">
<link href="__STATIC__/admin/css/bootstrap.min.css" rel="stylesheet">
<link href="__STATIC__/admin/css/materialdesignicons.min.css" rel="stylesheet">
<link href="__STATIC__/admin/css/style.min.css" rel="stylesheet">

<link href="__STATIC__/common/select2/select2.css" rel="stylesheet">
<link href="__STATIC__/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">

<link href="__STATIC__/admin/css/cch.css" rel="stylesheet">
</head>
  
<body>
<div class="container-fluid p-t-15">
  
  <div class="row">
    <div class="col-lg-12">

        <div class="card">
            <div class="card-body">
                <div style="float:left;width: 50%;">
                    <h5>订单号：{:$data['OrderId']}</h5>
                    <h5>创建时间：{:date('Y-m-d H:i:s',strtotime($data['CreateTime']))}</h5>
                    <h5>订单类型：{:$model->getTypeCn($data['OrderType'])}</h5>
                    <h5>订单金额：{:$data['PretaxGrossAmount']}</h5>
                    <h5>应付金额：{:$data['AfterTaxAmount']}</h5>
                </div>
                <?php if ($data['PaymentStatus'] == 'Unpaid'): ?>
                <div style="float: right;width: 50%;text-align: right;">
                    <a class="btn btn-warning btn-w-md" href="{:url('pay',['orderId'=>$data['OrderId']])}">支付</a>
                    <a class="btn btn-secondary btn-w-md cancel_btn" href="{:url('cancel',['orderId'=>$data['OrderId']])}">取消</a>
                </div>
                <?php endif ?>
                <div style="clear: both;"></div>
            </div>
        </div>

        <div class="card">
            <div class="card-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-striped">
                        <tr>
                            <th>子订单号</th>
                            <th>产品名称</th>
                            <th>实例ID</th>
                            <th>实例规格</th>
                            <th>应付金额</th>
                            <th>状态</th>
                            <th>订单类型</th>
                            <th>消费类型</th>
                            <th>起止时间</th>
                            <th>支付时间</th>
                        </tr>
                        <tbody>
                        <?php if (empty($list)): ?>
                            <tr><td colspan="100" class="text-center">暂无数据</td></tr>
                        <?php else: ?>
                            <?php foreach ($list as $k => $vo): ?>
                            <tr>
                                <td>{:$vo['RelatedOrderId']}</td>
                                <td>{:$vo['product_name']}({:$vo['ProductCode']})</td>
                                <td>{:implode('，',$vo['InstanceIDs'])}</td>
                                <td>{:$vo['OriginalConfig']}</td>
                                <td>{:$vo['AfterTaxAmount']}</td>
                                <td>{:$model->getStatusCn($vo['PaymentStatus'])}</td>
                                <td>{:$model->getTypeCn($vo['OrderType'])}</td>
                                <td>{:$model->getSubscriptionCn($vo['SubscriptionType'])}</td>
                                <td>
                                    {:$vo['UsageStartTime']}
                                    <br />
                                    {:$vo['UsageEndTime']}
                                </td>
                                <td>{:$vo['PaymentTime']}</td>
                            </tr>
                            <?php endforeach ?>
                        <?php endif ?>
                      </tbody>
                    
                    </table>
                </div>
            </div>
        </div>
      
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="__STATIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/main.min.js"></script>

<!-- 时间选择器 -->
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>

<script src="__STATIC__/common/select2/select2.min.js"></script><!-- 下拉搜索 -->

<script type="text/javascript" src="__STATIC__/admin/js/lyear-loading.js"></script><!-- loading -->
<script type="text/javascript" src="__STATIC__/admin/js/cch.js"></script>
</body>
</html>